<!--
 * @Date: 2024-05-13 09:15:47
 * @LastEditTime: 2024-05-16 10:27:06
 * @Description:
-->
<template>
  <div>
    <div class="pt-5  text-xs container">
      <PageList ref="pageListRef"  backTopTarget=".container" :downOption="downOption" :upOption="upOption"
        @downCallback="downPullCallback" @upCallback="upCallback">
        <van-cell v-for="item in list" :key="item" :title="item" />
      </PageList>
    </div>
  </div>
</template>
<script setup>
import {
  useTips
} from '@/hooks/useTips'
import {
  usePageList
} from '@/hooks/usePageList'
import {
  deepClone,
  isEmpty,
} from '@/util/common';
const {
  showToast,
  showConfirmDialog,
  showLoadingToast,
  showDialog,
  showLoading,
  showLoaded,
} = useTips()

const getOrderList = (newQueryParam) => {
  console.log('newQueryParam', newQueryParam)
  return new Promise((reslove) => {
    let myList = []
    setTimeout(() => {
      for (let i = 0; i < 10; i++) {
        myList.push(i)
      }
      reslove({
        success: true,
        result: {
          records: myList,
          pages: 3
        },
      });

    }, 1000)
  })





}
const router = useRouter()

const {
  list,
  downOption,
  upOption,
  pageListRef,
  queryParam,
  downPullCallback,
  upCallback,
} = usePageList({
  api: getOrderList
})





</script>

<style lang="scss" scoped>
.container {
  // height: 400px;
  // overflow-y: auto;
}
</style>
